with magick

Author

Tony Duan

1 create quarto blog

1.1 blog post

Code
---
title: "title"

author: "name"
date: "2024-05-03"
categories: [R,quarto]
execute:
  warning: false
  error: false
  eval: false

format:
  html:
    toc: true
    toc-location: left
    code-fold: show
    code-tools: true
    number-sections: true
    code-block-bg: true
    code-block-border-left: "#31BAE9"
    
---

1.2 hide post from main page

Code
---
draft: true  
  
---

1.3 _quarto.yml

Code
project:
  type: website

website:
  title: "tidystep"
  site-url: https://tidystep.netlify.app/
  description: "A blog for data stuff"
  favicon: "profile3.png"
  google-analytics: "G-2EQK8RFKFX"
  navbar:
    right:
      - about.qmd
      - icon: github
        href: https://github.com/TonyFly3000
      - icon: twitter
        href: https://twitter.com/TonyJCD
      - icon: rss
        href: index.xml

  page-footer:
    right: "This blog is built with ❤️ and [Quarto](https://quarto.org/)."

format:
  html:
    theme: 
      light: flatly
      dark: darkly
    css: styles.css
    grid:
      body-width: 1100px
      margin-width: 300px
      gutter-width: 1.5rem

editor: visual
execute:
  freeze: true

1.4 index.qmd

Code
---
title: "微步数据"
listing:
  page-size: 8
  contents: posts
  sort: "date desc"
  type: default
  categories: true
  sort-ui: true
  filter-ui: false
  fields: [image, date, title, author,categories]
  feed: true
page-layout: full
title-block-banner: true
---

1.5 draft post,not include in the main page

Code
draft:true

1.6 create password for blog

1.6.1 download staticryptR

Code
remotes::install_github("nikitoshina/staticryptR")

1.6.2 download node

Code
brew install node

1.6.3 Installing staticrypt

Code
npm install -g staticrypt

1.6.4 edit _quarto.yml

Code
# _quarto.yml
project:
  output-dir: "./_output"
  post-render: encrypt.r

1.6.5 add encrypt.r

password protect all website

Code
# encrypt.r
staticryptR::staticryptr(
  files = "_output/",
  directory = ".",
  password = "123123",
  short = TRUE,
  recursive = TRUE,
  template_color_primary = "#6667AB",
  template_color_secondary = "#f9f9f3",
  template_title = "Your Document Title",
  template_instructions = "Enter the password or contact example@email.com",
  template_button = "Access"
)

password protect one posts

Code
staticryptR::staticryptr(
  files = c("posts/youtube_yt-dlp/"),
  directory = c("docs/posts/"),
  password = "123123",
  short = TRUE,
  recursive = TRUE,
  template_color_primary = "#6667AB",
  template_color_secondary = "#f9f9f3",
  template_title = "Your Document Title",
  template_instructions = "Enter the password or contact TonyJCing@outlook.com",
  template_button = "Access",
  print_cmd = TRUE
)
Back to top